package day02;

import java.util.Scanner;

public class Random2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 获取键盘输入值
		System.out.println("请输入一个数：");
		int a = sc.nextInt();
		int count = 0;
		while (true) {
			//计数器
			count++;
			double b = Math.random() * 100 + 1;
			int c = (int) b;
			System.out.println(c);
			
			if (a == c) {
				
				break;
			}
			
		}
		System.out.println("循环了" + count + "次");
	}
}
